Fix subdirectory parsing