Fix Brezenhem's algorithm