Fix check for virtual variables

It's only possible to check variable.index for 1d variables.
Merge pull request #69 from akleeman/fix-virtual-variables

BUG: Fix check for virtual variables