Improvements to Vi inputstream_handler.