Support same-doc refs and multiple signatures.