fix g_ motion in internal normal mode
fix tests
add tests for state