bugfix: args.output is removed by the patch

- also, follow the latest code in utils.py