Fixed issue with perfectly verticle lines and lines with shallow slopes