upd: template fixes, added array handling