TC: fixed bug with non-existant dirs in list_templates()