fixed a number of table refs, etc