You only have the # character in two of those lines, so the ON QUIT event can be eliminated as the problem section.

What you should do is figure out which of the ON JOIN or ON PART events is causing the problem, as based on the code you've posted, everything looks fine.

One other possibility, that I can't see here, is that your codes might not be lining up properly. Please copy & paste the code exactly as you have it, and remember to use the Code Tags (button looks like #). This should allow us to see if the code is being aligned correctly.