fix UnicodeEncodeError exception when reading headers. fixes #106, #108, and #114.
comparing to None explicitly