Fix for ruby 1.8
Merge branch 'ruby-1.8-compat'