Fixed encoding stuff so it could run as python2 or python3