Fixed get-sequence to correctly extract the actual DB sequence number
used.