Move root check to before DB initialization