Change how sequence value is calculated. Still not 100% sure this is correct. Requires more investigation.