Tidy input buffer handling