Improve error handling for undefined subtrees

Fail the build and log out with a marginally more helpful error message when a subtree is `undefined`.