Adds test and fix for overflow in capacity calculation in resizing sparse matrices.