Fix bug in OLM during spanloss computation