Fix plugin application order