Fixing up database