Merge branch 'spectrum_array_fix' into 'master'

Update array indices to prevent out of bounds.

See merge request !88
10 jobs for master in 21 minutes and 18 seconds (queued for 2 seconds)