-Scheduler had a slight race-condition in which an scheduled agent could
get the scheduler before it was added to the agentFactory.
-Fix some warnings