Fix for #1648: Graceful error on dynamic trees
Test for #1648: NPE when encountering dynamic attribute
Updated existing tests for #1648: NPE when encountering dynamic attribute