Many ncurses fixes