Code and docstrings cleanup.