Fixes some legacy features of python 2. Its now compatible with python 3.