Fix some Smarty filter bugs after switching to Smarty 3
Fix more authentication issues after switching to Smarty 3