Fixed template for loop; added regression test to check content