correct ranges for subterms