Added the reverse alphabetically sort option.

A few code updates and fixes.