Fixing some crashes related to Java static methods