VW: Fix median calculation