Fixed certificate check code (Fixed #263).