Adjusting C++ files to compile with gcc 4.9.3