Changed returned string from leaves to unicode, it was causing encoding issues