Small changes to make tf work with the simulator