[#1792] Fix issue when sorting by field with whitespaces