That double-quote character at the end of the KeyExist line is not a normal double quote, it is a "smart" quote.

You get these if you copy'n'paste from the manual or if you use something like Word to edit your script.

Replace it with a normal quote character and you should get a better result.