Fixes to compile with g++