Merge "Cleanup static references when quitting." into ics-mr1