Small cleanup in agent