Fixed typos and code updates for Python 3.