Fix db initialization