Added USERERR to tErr enum, and basic global state error handling.