Fix missing declaration
Remove superfluous azure pref check.
Prevent crashes due to the allocation of source surfaces to errored surfaces.