Fixed infinite recursion bug when constructing a fill-template command. refs #416