Fixes plugin shutdown.