Improved Genie handling of stream EOF.