fix assert in lineardouble; make locate_sequences lazy