Fix deltaX and deltaY initialization