Build fixes on OS X