Sliding window iterator and minor bug fixes.