Fix NSUInteger/int and enum warnings when strict compiler options enabled

I compile with int cast checking and enum value range checking enabled, and that flags a bunch of warnings which I've cleared here.  Mostly it's inconsistency in context as NSUInteger vs int type.  This makes all of them NSUInteger consistently.