fix uniqueness issues in candidate ids, closes #773