Ok, Patch finnished.
I only edited divert. php, to add a few things:
1. Added a check to see if there are ANY departments, and gives an error if not.
2. Removed the "Error" message, by giving something to the template to make it say you are busy.
3. Let the departments show up in the list, so the undefined index errors got away