fixed errstats unit tests