Fixed array not string bug

Corrected mistake in handling array.
Threw in some quick and dirty validation.
(This is a true throw-away project.)