Improved docstring and other minor changes