full code comments on errstats + fix on contour computation when optima cannot be found correctly, ref #30 #31