Fixed java problems