Various delete-related fixes