Fixed a bug in the direction calculation for the 2D FFD movement.