Added some changes to equals and the database test