Fixes on update_table
Fixes on foreignkeyfields