Fix to _setup_next_sequence

...Added except clause that will catch TypeErrors and return 1 + the count of existing records

Not sure how to test this in the existing tests