Merge pull request #231 from nhr/array_protection

Trying to make more flexible template logic
More robust handling of arrays that may be parsed as strings
Merge pull request #233 from nhr/improved_array_protection

Improved array protection