Improve Java compatibility.