Cast all instances of unsigned int to int to squash warnings.
tweak