Fixed negative (wraparound) subscripts for list, node and adt.

Also added tests for these cases.