Improve span handling.