fixed build errors after merge
Fixed database version checking