Add docstrings and fix lint errors.