Fix/java varargs

A series of fixes related to the problem of passing varargs to Java methods.