Added improved exceptions for handling return codes from curses functions