Fix generate_signature_hash error and handle in check_signature.