runcmd: fixed context issues