iOS compatibility fixes