OS X build fixes