Some minor template fixes
Merge branch 'minor.fixes'
Flush the session
Some more tweaks to templates