BF: residual fixing for zvalue added -- doctest