Fix authentication bugs due to switching to Smarty 3.