Fix detection of submodules