Fixes and unfixes to get IO#gets more functional.