fix compile issues on macosx