Added support for compiling on OS X.