fix various compiler warnings on gcc
removed more dead debug code
more warnings fixes
more warnings fixes
more warnings fixes
Merge pull request #1439 from ZappoMan/fix_warnings

fix various compiler warnings on gcc