Restore Ruby 1.8.7 compatibility

And lift hard-coded Ruby patch level restriction.