convert Set to Array for #sample (needed in Ruby 1.9.3)