Fix exception when trying to get EndOfStream value