Fix warning about files being left open
Fix incorrect number of rows in summary unit tests.