corrected functions for enclosing containers and compact identifiers - there was a clash when they were used sequentially