Small improvements to subdir handling