Fixes an issue with updating to the new database structure when no facilities have been set at either a unit or property level. Thanks to Martijn Haan for identifying this issue and testing the fix.