Added sortfile directory. Bugfixes.