Fixed some problems with exception handling.