Fix some input bugs