fix problem with old 1.8 ruby and Hash.to_s/Array.to_s

In ruby < 1.9 array and hashes would be recognized as numeric
if they have a special format:

1.8:

  [1,2,3,4].to_s = "1234"
  {1=>2}.to_s    = "12"

1.9:

  [1,2,3,4].to_s = "[1, 2, 3, 4]"
  {1=>2}.to_s    = "{1=>2}"