Yeah I know I made a mistake in my program, I'm not even remotely trying to blame this on you guys. I don't think I want to merge the two functions (is there any upside of doing so?) and I will change the database module quite a lot in the near future, so I'll keep your third option in mind when I do so.
However, this thread is not meant to be about my bug (even if the bug made me ask this), but in general about a better AutoUnload. Is there any reason to do it the way it currently works, instead of just storing all AutoUnload instances? If we were to store the intsances, it would avoid many bugs and would allow us to define AutoUnload instances inside of classes or functions, and they wouldn't have to be at the module namespace. It seems like overall better option to me, not because it would've fixed my exact bug!