Well, it is just a fix, not a complete rewrite to fit coding guideline.
Do you really want me to remove these extra spaces ?