Clean up the recursive identifier search to make it more restrictive, fixes some complex use-cases