Fix some bugs in input window.