Fixed problems with util.py