Make the sweeper script slightly more robust.