Fix bug from datadir change