Build fixes for OS X