fixed some bugs in difference spectrum tool