Fix overstepping on diagonal.