Add fallback for sample in Ruby 1.8