Tweaked objectcontainer.cpp delete method