Fixed issue with db version being set to wrong value