Added application sort, minor changes

Closes #1031