Updates for python 3; fixing string to bytes weirdness