fix minor bug with rounding errors when error is zero