Build: Added sane checks in for missing elements.

generated from commit 14089323b2adcde16b6ff6284ad2175cd85a0958