Improve agent tests