Free modules before main config

Now that the modules are cleaned up correctly