Fix issue with unloading modules before they were added to the stage