Made fix for 'nonexistent directory' error only be applied once