bugfix to rebase into the 'More handling of collection deletion' commit.