Fix failing test
Replace range with xrange