Fixed add / edit user departments bug (#338).