Fix exception that occurs if user manages to have no module selected
issue #1011 if H5 dataset has no elements, recast does a bad thing in __setitem__. Fix + test.