Bugfixes, improved sweeping.