Changed exception handling.