Fixed a just introduced bug in Agent.getState()