Fixes for Mac OS X and parallel compilation