Bug fix in the sequence dialog. Also fix the unit tests.