utils.py fixed to work on OSX