compatibility with ruby1.8

Hey, I'm using your gem in a project with ruby 1.8 and I did some changes for compatibility. I don't know if you what 1.8 compatibility, but here are my changes if you want it.