Plugin disposal improvements (fixed NPEs).