More and last fixes for building with gcc/g++ 4.7.x

Sorry I didn't send them all the fixed in one request, but here are all the rest.

Have a good day.