Do not load tree element.
(cherry picked from commit 657171b)
Improvements for stubs
(cherry picked from commit ac902b4)
Fixed compilation
(cherry picked from commit 901b43d)