It should be between 0 and len(tasks) due to some strangeness in how moving between tasks works.