implement correct sorting by filename to fix #20