Fixing build issues on MacOS X