Fixed issue with itertools.islice() performance