Fix to bug #1367 where coefficients returned by R would be NaN.
In which case, the value returned is replaced by 0.
Also fixed issue where the coefficients displayed in the equation text
are wrong.