Fix TreeView sorting

Fixes #5