Fix bug where exception is thrown when H5 file is in use

Resolves issue #28 

Pls review @burtonjb