support compile on mac and fix one typo.