Rewrite tests to make them work with Ruby 1.8