Reverts some geometry code to a functional state.
Fixes #4045