Fixed connection to DB when parameters are not standard