Fixing xrange incompatibility in py3+