Fix geometry

I have redone the pull request to match master, hope that helps!

Jack.