Fixed grid coordinates so that the Z always has the correct sign