Fixed repository cleaning code.