Corrected logic on extracting spec for linktree