Revert "Some methods should use uint instead of int"

This reverts commit fe2b379e1e6ab254fc0768d176b399a8aacfa97f.