Fixed bugs in Simulator implementation