Fixing minor bugs. Docstrings, comments.