Added all database classes and fixed some errors.