ruby 1.9 support

I have attached a fix for ruby 1.9 that uses the BasicObject and also removes a warning when running under ruby 1.9