simulator: prevent loading module twice and fix unload