Fix code that does not compile for iOS properly