Windows compatible, fixed bugs

Made compatible with windows for soil, also fixed seg fault issues with
iterators.