Fixing some build errors on OS X