Fix conversion from C# integers to Java integers