Fix wrong data being sometimes shown in history
Also fixes hangup for some profiles, where thousands of events appeared even though they shouldn't have
Also fixes hangup for some profiles, where thousands of events appeared even though they shouldn't have