Ensure span sizes are positive
add some basic tests