The candidates array had a very very very high chance of being sparse, which effectively broke the logic. It was mostly harmless since said logic is only here for a long and varied history of backwards compatibility ;).