Issue 4939: Fix sort function on state column.