setupkernel now returns the number of bad keys that were found