Fix compilation warnings
Fix bug when adding an agent with its own position attribute

previous code suffered from aliasing problem where the pos parameter
was aliasing with ag.position and was reset in agent.init() resulting
in an intial position of (0, 0, 0).