Return correct exit code on command failure