Fixes for utf API and workaround for UTF filename bug