Add a test_executeWaitedCommandAction() and fix bugs that fails the test.