Corrected nested exception handling