Fix type conversion during set