Fix handling of profile_dir