Fix for monkeypatched String#to_hash

If one has a `String#to_hash` defined then all of the strings in
parameters, environments and such turn to hashes (depending on the
method), but might look something like `{ "foo" => { "bar" => nil } }`
instead of `{ "foo" => "bar" }`. This fixes that. Not the DRYest
solution and not sure if everyone wants to support things like that, but
does the job.