Fixed a bug where ncurses wouldn't clean up