correctly forward exit status if available