Fixed some docstrings, typos, python3 string method compatibility, some errors that crept in during rebase