Bug fixes and unit tests

Fixes to the Facility configuration page and validation