some python2 fixes and remove a copy