Correctly detect invalid state.