Fix type conversion warnings