bug fix to order of template arguments, additional test for var, plumbing for generator to ensure covariant returns