Fix input stream readable check