Fixed unicode coercing to avoid UnicodeDecodeErrors