Add error checking for newwin.
Merge pull request #6 from xales/error-checking

Add error checking for newwin.