Never change the code provided in a question, under any circumstances whatsoever. You cannot know if it's the cause of the specified problem, or the cause of a different problem, meaning that your edit could potentially deface the meaning of the question, and no one likes that.
Inline-Comments are an exception, but please do not change the actual code in questions. This only leads to confusion ("Your code is working fine!" [Post-Edit]) and anger ("Why did you fix the issue by editing instead of answering?").
Instead you should use an answer to point out typos or bad practices. Alternatively, use a comment if you think that these points are too minor to be an answer or do not cause the main problem specified by the OP.