Fix proxy function for Java