Changed the offset used for creating array (spectra) memeber inidicies, previously there might have been an integer overflow problem.
Also added a little more debugging output to the tree creation section.