Minor improvements to module reloading