More fixes for utf-8 support