Allow for more general TGeneralRef1's, including logical indices.
Introduct TScalarRef1 to fix some test failures.