Fixing a bug in the io.js
Should not read more than available from stdin