docs update and code changes to make Sphinx happy