Bug in Advanced sort fixed