fix bugs in cert assign/reassign, closes #226