Improve agent test