ExtractVariable tests and improvements