Improved submodule handling