fixed problems with partitioned collections and metadata

#967 #997