Fix error scope