Fixed formatting functions. Added perl script to remove buggy formatting. Added ClearBuggyFormatting.