Updated some relations to fix foreign key problems when deleting
fixed test
Merge remote-tracking branch 'origin/master'