missing paren
deleted one line for the sake of deleting one line
+stat -> stat; 'stat/template' work

Templates are now a single string item, not a list of major/minor templates; this was just too difficult to maintain
moderate overhaul and cleanup