Fix runtime errors with catch cases.