Fixed database initialization