fix for subtrees with no type keyword
unit tests added