fix some compiling errors on iOS