Fixed even/odd bug in median