Fixed Java compatibility