Fix bugs about input.