Fix insertion of nearest neighbor and 'current event' duration during distance calculation