Increase test coverage in utils.py