Ruby 1.8.7 compatibility
Merge pull request #80 from ninech/ruby-1.8.7-fixes

Ruby 1.8.7 compatibility