check_agent_changes now doesn't cause an exception if the map field of the agent is not set, which is the case for items that are in a container.
It will also throw a more meaningful error when the map is set to a non existant map.