Enable and address extra warnings
Mostly unused variables and signed-vs-unsigned integer comparisons, although this uncovered a couple of minor bugs.
Mostly unused variables and signed-vs-unsigned integer comparisons, although this uncovered a couple of minor bugs.