Fixed a validity check in nearby button listing

Somehow the y_iterate loop was running for more than 8 times despite the
iterator list size being 8. This resulted in 'index' becoming 8 or
higher and crashing the quicksort function.