More changes to make compile with g++ on Linux