Potential fix for a crash reported when loading submodules

Relates to issue #131