Typo, white-space, PEP8 and formatting fixes.

This refs #6664.