Enhanced exceptions handling.