Fixing more problems revealed by gcc