Update to run tests successfully
Avoid encoding error caused by appending bytes to unicode xml message