fixing autogenerated headers in document templates