Fix string/array each issue

Ruby 1.9 doesn't like string.each - this changes it to an array.