spectrum: fixed a couple of bugs