Fix data input bugs.