Ensure that dsid and type are provided to has_metadata. Fixes #309