Fix reusage of stdin.