More exception handling was added.