Use a cast when formatting NSUInteger values

The compiler generates the warning Format String Issue when
formatting NSUInteger values (e.g. [array count]) without an explicit
cast to unsigned long.

Also, use %lu and not %ld when formatting unsigned values.