Changes to make UTF-8 encoding work