Mac OS X build fixes