Tweaks to compile without erros and warnings on gcc 4.7.0