Bug Fix: Avoid exceptions when deleting objects.