Fix compile issues on mac