Adding python 2 support for simulator.