Fixes to compile with g++ 4.9