Fixed issue with gems having wrong data on tree manipulation.