Fixes

* Fixes #5881
A better fix would probably involve the module's loc not becoming null, but unfortunately it's being done all over the damn place so this will have to do for now.


* Fixes #5893