Misc cleanup and docstrings