Fix treatment of subdirectories