This was broken by an unintended indent in the code on a redirect, allowing code above this checking for # facilities==0 to fall through down here.

As discussed, Richard will update with a fix to that indenting, so that this code only gets hit when there is indeed a facility.