fixed some enumeration and state resolution problems (I think)