Fixed clear_invariant to work with new style. build_seq now looks for missing values.