DB connection fix. To be cleaned.