Reintroduce check for submodules
Merge with upstream
Fix pexpect import path