When converting template variables to view objects, handles arrays carefully.

Fix output formats test.