UDL: fix detection of nested COS blocks