Changed int cast to integer division.