Fix illegal data type conversion