Improve the logic in the joystick testing.