Fixed directory test typo and added test case to cover this fix