Bug fixes for displayGeometry function.