Added logic for unloading impact functions and called it before plugin unloading