Fix a lot of warnings for GCC

Less than 20 warnings remaining on my x86_64 GCC 4.9.1