Backported fix for commitChanges to log when there is data to log