Should avoid crashes when removing modules