Fix datadir

Cherry-picked from master