Fixed java sorting