Refactors and fixes a typo-error in CommitLog.