Fixed file sort issues