fix compaction (thanks @garwedgess)