fix common problems and fix smarty support in plugins