Removed range() calls in nogil sections for Cython 0.18