Fix some Ruby 1.9 encoding problems