Fixing bug in Simulator