Fix ring-buffer ordering issues.