Fixed problem with self-referencing tables.