Fix spelling mistakes.

Also remove several trailing white spaces and blanks before tabs.
Use boolean logic

Use "True" instead of "1".
Remove unnecessary parenthesizes.
Remove comparison with "True".