Avoid overflow
BUG: indexing tweaks
Test `median`