Fix an incorrect type cast.