Fix some edge condition errors in the format 4 compaction code.