Fix conversion-loss warnings

Fix "implicit conversion loses integer precision" warnings by changing int to NSInteger (long)