Fix unexpected regression, use better approach to preserve singleton methods added by unit tests.