Improved database, fixed entities