Partially fixed joystick code