utf-8 fixes and other build quirks