Add moves for state. Fix some bugs.