Weakly-Relational Shapes for Numeric Abstractions: Improved Algorithms and Proofs of Correctness