Fix strict(er) compiler warnings.

* mismatching variable types (int vs. NSUInteger)
* Variable incorrectly flagged as __unused
* Mismatching .h/.m return and parameter types