Fix syntax and whitespace causing python 3 problems