Minor fix and added dependency on six

Fixes to make it work on python2.7 again.
Dependency for package six.