Docstrings and minor cleanup.