Made change according to code review. Refs #9244.

1. Add a case in addValue to switch from unknown to unsorted;
2. Fixed an indentation issue.