Fix slowness in PathMovement on slow machines (fix #311).