[FIX] fixes tests failing win debug mode

this pull request fixes two tests that fail in debug mode on windows

 * median computation on an empty range of points
 * derefencing an iterator pointing to `vector.end()`