Fixed minor bug in spectra.c.

An array was being indexed with a potentially uninitialised index.