Proper sorting of redirections