Adding more code to pass auth tests in db_tests