Enhanced the fixing code

Now can delete extra "," and ";" left behind.