Fix tree spec.
Add test for head change to e2e tree spec