Fixed #814 Sorting of candidates in the assignment