Fix shell dir tracking.