fix python 2 vs. 2 compatability issues