Changes to get tests passing on Ruby 1.8.7