Fix type conversion