Changed casting from Integer to int