Fix scope and naming of some variables

Not sure why ASAN did not complain that the old code sometimes used
dvdl when uninitialized under RF.

Updated copyright header

Change-Id: Ib534dc4aa8128f58a80689d5f33282fb16967b1e