Make compliant with Python3. Prettyfied error messages.