Fixed table-to-table assignment, added test