CA-121503 - Make use of rc and stderr when appropriate.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>