Fix datastore directory creation bug