Fixed an issue with placing shapes above existing shapes, did some other cleanup.