Fixed MacOS build issues