Fixups for small errors and warnings found on gcc 4.7