Add logging, fix the SimAgent registration problem.