Fixed utils.py for Python 3