Fixed corrupt module unload order on application exit.