Fix bug in slopeTo().
Add small optimization.