Sort multi candidates at compile time.

This is instead of doing so on the first call.
Refactor to avoid some control exception use.