Fix some places where encoding issues manifest on ruby 2.0