Revert ""Fixed" the geometry bug."

This reverts commit c3e65ec73f173e71fefb60b230972b56cb8fff22.
Real fix for the geometry problem.

Ok, setting some vars to double was a nice way to make unit tests pass,
but I prefer a real, working solution.