Fix bugs in verification process