Minor changes for g++ compilability and C++11.