fixed saving of collection's categories, fixes #47