Fix reading of data from stdin

The code mistakenly tried to read from stdout which is rather impossible.