Fix a bug when using --stdout, introduced in e14ac00.