Fixes to compile with gcc