Fixed template to handle EOF newline