Fixing Issue #49: Closing dataset used for metadata initialization