fixed bad logic for isleaf field (need to compare as char, not boolean)