Fix bugs in yii\smarty\Extension