fixed minor boundary issues

Fixed boundary issues for log-likelihood update when adding and
removing a spike