Fixed some input bugs.