fix bug in Span parsing
add Span parsing tests