Correct invalid scripts