Add cast to int for subtraction in long arithmetic