Clean up light references and secret references.