Correct invalid references