Added sortfile directory. Bugfixes.
Merge branch 'master' into sa