Fixed iOS and Mac OS X implementations