Fixed basic logic error in DB initialization