Bug fixes to variant tree