Make sure next_submission_id always returns the most recent regardless of status
Don't run sanity check unless the submission is valid
Don't always remove index
Test error fixes