Fixed missing cast to int for count