Fix of recent geometric algoritm.

- Also now the better spec is written for it.
Merge pull request #45 from stanislaw/master

Fix of recent geometric algoritm.