Fix factory compilation cache -- was wrong handling of cleared WeakReference-s