Fix cmd string to replace placeholders correctly.