Add explicit list(range(...)) for py3 compatibility.