Ensure values get returned and handle rounding errors

This PR adds tests with slightly more complex matrices that showcase the need for rounding values and returning also for `0` rows, and also fixes for the issues.

cc/ @d4tocchini who ran into these.