docstrings and minor fixes