Make some variables static (should probably adjust for coding style too, but I'm not the one who merged code with bad style...)
Fix signed/unsigned comparison and unused variable warnings.
Merge pull request #1284 from comex/even-more-warnings

Even more warnings