Don't rewrite same value multiple times, pep8 and doc fixes.