Fix bug in compaction.