changed Array.to_h back to Hash[Array] for ruby 1.9.x and jruby