Fixed some build issues on mac