Fixed compilation warning.
Fixed exit code for test scripts.
Add sleep time in test script.