Adjusted exceptions to use new handling. We throw before returning undefined.
Merge pull request #9 from tyduptyler13/master

A few small changes to exception handling.