Rearranged code and added config saving onDisable.