Fixed bad exception handling.