The table is now cleared when the switch finishes. Avoids having to remember to set this up manually. Also, no longer yield when returning a cached ref. Seems unnecessary, and could cause a leak if cancelled.