Various fixes after switching to Smarty 3