Only fail if retcode is non-zero

Fixes #16437