#343 wrongly placed candidates.clear() causes too many error messages

Error made in merging #343  and #65. Candidates are not always cleared, causing wrong and too many error messages.

No reproducer is present (new functionality).