Fixes #2676: safe functions for retrieving condition/grade by facility.

Fixes #2676.