Regression fixes (unrefactored code + UTF-8 patch)