fixes to make work with python 2 as well as 3
fixes #2