Small changes to make this gem compatible with Ruby 1.8.x.

I ran the test suite with both 1.8.7-p370 and 1.9.2-p194 before committing these changes. Everything seems to work as before.