fix a severe bug in bresenham.

and nother updates.