Minor fixes for allowing the code to run correctly in the simulator.