Too tired it is. Makes almost perfect sense now! Didn't take in count that the variable wouldn't count as local after the unset.

Since in theory you can't have same global and local variable at the same time, shouldn't the first var line in the script overwrite any existing global and local variable?