Minor fixes to make sweeps work with python2.7