HDF5 bug fixes
Seems to work but I removed the start_new_thread for writing the file.
It didn't work because of concurrent access (still some improvements to do).