More reliable method of finding the priv_dir.