BUG: Fix check for virtual variables

It's only possible to check variable.index for 1d variables.