Some adjustment to build with Mac OSX