Implemented two-level ids, duplicate interval insert detection, and fix for seg fault in topk.