Fix output when run as a file or with "-m"