Fix foreign key DELETE and UPDATE actions, fix user removal