Adding test for copy_terms_in_function