Small bugfix in poll_agent