Issue #286: correct some of the repository cleanup code