Various fixes to compile with GCC 4.7