CMP: Fix some python 2.6 and 3.X compatability issues