tg-summary.sh: restore correct -i and -w operation