check invariant and give correct error message

defaultSubState check was replaced with a different check in #4
keep them both