Fixed bug in sweep