fixing osx compile bugs