Fix db detection