Finishing part of agent and wrapper
Fixed bugs commit