Bug fix in hdf5 dumping

Fix matrix size