Python3 compatability
Some more cleaning