Fixing a bunch of warnings that show up with -Wall on gcc 4.6.2