Fixed handling of department_actions foreign key during department deletion.
Fixes #163