Bump version number to 1.5.1.
Fix issues with edge snapping on straight path segments.
Simplify logic.