Added enable compaction constant.
Fixed typos in for-loops.