Build: Added sane checks in for missing elements.

generated from commit d846e023402c6f43e3960806bef01955a9669c2c