fix some compile bug in Mac