Fix problems compiling with gcc4.7