Fix errors and some docstrings.