Revert isLeaf test to use strings

redo change to string comparison for isLeaf test that seems to have been munged by bad merge.