Build errors fixes for Mac OSX.