fixed crashing due to keys
leafconnected works\! close #16, #27