Replace fmt.Sprintf style error messages with fmt.Errorf