Fix various compiler warnings with gcc-4.7