Fix InputManager bugs (#38)