Fix and additions

Add median function
propagate timestamp with select function
Fix span