Replaced all instances of int with NSInteger to correctly support 64-bit.