Fix DB version check
Partially fix unit tests