Fixed handling of profiles in subdirs