Fixes the template used when generating code, which in some scenarios would lead to panic instead of returning an error.