Fix memory management on tests and deprecate DefaultServicesTrait