Major iOS fixes for the device module