simplified last_zero calculation for errhist