fixed infinite loop in IterativeStore, and closed http connections where necessary