Get rid of Integer reference comparison

The current code does Integer reference comparisons. When possible
int primitive type should be used.