Fixing <ref>s with attrs