Fix errors, update docstrings.