Fix an issues in sweep tool.