Removed "recursive DestroyCompoundShape and moved some code to its appropriate place