Fixed isdir function.