Line algorithm bug fixed