Fixed possible bad mode instantation when restarting module

I will do the 3.5 fix in another branch