Fix calculation of range selection duration