Fixed a flaw in code that left output as an array