Ensure global flag gets removed, and ensure the correct module is being undefined.