Fix module cleanup for some modules