bug fixes in compare_shapes (removed some rot that accumulated)