Fix the way referenced geometries are handled