Fix wrong logic in InputChannel and RecordDeserializer