Fix some warnings from Xcode 5.1.

One -Wshorten-64-to-32 and two -Wformat warnings, all from misuse of
NSUInteger or NSInteger.