Is there any reason why this returns an Integer instead of an int?