Partial implementation of proper_fsm.