Change type of getch_base(), and fix test_gets.