fix some curses problems and improve the configure script.
13 files changed