fix compile bug and most warning