Fix selecting columns by name instead of index; add tests that verify this behaviour.