Bug Fixes by DM #1

Succesful Compilation of Agent class as of this commit.