Delete objects in the reverse order they were created

Replaces #316.