Fix an incorrect modulo operation