Fix NPE when the quax for sorting is not specified.