A few python 3 fixes