Replaced nested try-catch blocks with macros.