DEBUG: Add instrumentation to Shell.java to diagnose "exitCode -3" errors