This code really should be moved to replace verifyAndGetSchemaVersion, right? It seems to replace that code, and it's pretty messy to put here directly.