Fix sort.pl and update documentation for fix_headers