Fix AGSTATE parsing.