Fixed errors being thrown when a shape is removed. Other general updates.