Fixed bug in new spike detection