Add a missing deref() and rename some vars for clarity.