Add agent tests and update