Fixed memory leak, removed references that caused copy constructor of Agent, made copy constructor private