Fix issue where input never end()s