The problem is that you can't compare `None` with an integer in python 3.x. Since you know more about this code, feel free to improve using this commit or using the master branch, I may do some work on this tonight.