Bug in logic to get_or_create that caused uniqueness constraint to fail.