Fix broken compact() method