Restore compatibility with Ruby 1.8
Fix broken analytics code