Fixing tree bug