fix use of median and handle nulls in test_run_id