Fix bugs in interval-based builder