Fix is_dir.
Added special case handling for weird short paths.