Fix deprecated error access