Fixes #5059 - Returns error message when sorting by wrong column.