Thanks Gianluca! Of course, I meant to index v from 1 to 5 not 0 to 4. Comes from spending the past 2 months programming in Racket and Rust... how quickly I forget. :-/
When the variable heading becomes zero, the test nv[[heading]] == hlim becomes List==5, which may not be what you intended.
heading
nv[[heading]] == hlim
List==5