Fix a bug where a template "endif" was removed
Merge branch 'fix-session'

* fix-session:
  Fix a bug where a template "endif" was removed