Revert "Removed an unneeded implicit conversion from NSInteger to int. Fixed some ambiguous constraints."

This reverts commit d09b278a71a48d44e5289f07fde0e65db64d0cbb.