Clean up instrumentation code.
Ensure missing services/contexts will not crash the IDE.