Fix target host variable being overwritten

Resolves bug 1133204