Refactored the code a little in execute-command.c and made test-exec-ok.sh work better.