Fixed table-reduce; I actually didn't understand my do statement and
so it didn't work in some cases; now I've fixed it.