Cleaned up and fixed conversion to UTF-8