Some minor fixes in simulator code