Adds support for OS X and a check for ARC in a few places.