Fixed bug with reading stdin