fix some bugs by g++ on ubuntu