A few small changes to exception handling.

Adjusted exceptions to use new handling. We throw before returning undefined.