NOJIRA fix mis-assigned variable

$vn_i is defined in the row above and is used below. This changes the variable.
Merge pull request #165 from kehh/misAssignedVariableUpstream

NOJIRA fix mis-assigned variable