Edits to support py2 vs py3 differences