Issue 3153 invalid certs

@6a68 and @jrgm - can you review my second commit? The first commit that @6a68 did looks good.

* Remove stray underscore leftover. fixes #3153 
* Add a proper failure callback to cleanupIdentities.