Fixed Database.class implementation and added a new test case