Fix history entry ordering