Fixed null pointer exception in directory search.