Properly handle submodules