Standardize sequence handling, add set support