Renamed DB parameters and fixed db access