Added ruby 1.8.7 support

Hello,
I hope you want to integrate these simple changes to allow its use even in old projects.
Thank you for your precious work
_Marco_