Fix $? reporting for corner cases