Fix issue with replace_template and @require