Fixed code that was not python 3 compatible.