Added exception handlers.