Improve detection of last declaration in DeclDefs