Minor bug fix on compaction