Fixed and closed #47.  Added some exception handling