Fix some minor warnings.
Fix some printf size warnings, signed warnings.
More signed compare warnings.
Support builds outside the git dir.

Oops.
Merge pull request #841 from unknownbrackets/warnings

Warning fixes