correct _no_extra_states function and add tests for it