Updated version.
Fixed disappearance of consolidated states when states were sorted.