Cleaning up templating errors