Fix garbage collection of recently added classes