Code fixes for GCC

Compiling against GCC 4.7.1 now and fixing code so that many warnings go
away.