Fixing problems with the communication to java