[XProxy] Avoid blindly putting const refs, fixes #1764.