Remove junk code in _checkState
Fix #13 and fix #14