Build: Added sane checks in for missing elements.

generated from commit b54292e2676daf0e6e42d22eab7193af5d3fe0fb