Fixes bugs in the span refactor.