F}_{\rm mod,i}^2/\Delta{\rm F}_{\rm obs,i}^2)}$$

In both expressions the sum is performed over the full wavelength range. ${\rm F}_{\rm obs,i}$ and $\Delta{\rm F}_{\rm obs,i}$ are the observed values of the flux and its associated errors, respectively. ${\rm F}_{\rm mod,i}$ are the corresponding values of the theoretical spectrum.

To avoid the fact that points with small observational errors have an excessive weight in the fitting process, we calculated the average of the error values in each spectrum as:

$$\label{eq:chi2c}
|\Delta{\rm F}_{\rm obs}| = \frac{1}{N} \sum_i\Delta{\rm F}_{\rm obs,i}$$

Then, we fixed the error to be half the average for those points with smaller errors during the fitting process.

Overall, we find that the BT-Settl reproduce well the SEDs of metal-poor M dwarfs and in particular the main molecular bands. However, we noticed that some of the main atomic lines are not well reproduced: ((Figs. \[fig\_MplusTeff\_sdM:full\_XSH\_model\_lines\_sdM\], \[fig\_MplusTeff\_esdM:full\_XSH\_model\_lines\_esdM\], \[fig\_MplusTeff\_usdM:full\_XSH\_model\_lines\_usdM\]). The lines of the sodium doublet at $\sim$820 nm predicted by the BT-Settl models appear too broad for spectral types later than approx M5. The calcium lines seem too narrow for ultra-subdwarfs but look correctly reproduced for subdwarfs and extreme subdwarfs. This mis-match between observations and models yields over or under estimates of the abundances of 