Made the jump detection more robust.