Various OS X build fixes.