test Jstar for NaN/Inf, return NaN/Inf for cond() and exitflag: -1, other minor fixes