Defensive programming

Placeholder post
Revert "Defensive programming"

This reverts commit a39eff1359e28da070c1e37bb6f8e4a6b41a1c33.
Revert "Revert "Defensive programming""

This reverts commit 2750ec79b3af28894148363ae92175b24e324474.