Some fixes for table join

Fix
- shift of joined fields (7068-1)
- restoring joined fields from project files (7068-2)

Also fix
- refreshing field names after encoding is changed (6840)