Fail if given an unknown state

I just lost hours debugging what the hell is going wrong with this module. In the end I found that I mis-spelled the state: "preset" instead of "present". The code just skipped everything, no return, no error report. 

It should fail if given an invalid state.