fix templating of arrays