Fixes #4553: Smarty enhancements