Additional checks and descriptive error message against opening db in opening state, additional tests