Compiler warning fixes
 - unsigned/signed comparisons
 - unused vars
 - var init ordering
 - missing cases in switches
Merge pull request #74 from asmaloney/compiler_warning_fixes

Compiler warning fixes