bug fixes and docstring changes