Fix #103, add support for trees and butterflies