Fix an issue with it only replacing the first occurrence of the template within the file