Fixed reading from STDIN