Solve concurrency issue and update 2 shell scripts.