Minor cleanups of dependencies and encoding for python2.7